package javango.db;

public interface Paginator<T> {

	/**
	 * Returns a Page object for the given 1-based page number."
	 */
	Page<T> getPage(int number);

	/**
	 * Returns the total number of pages.
	 * @return
	 */
	int getNumPages();

	/**
	 * returns the total number of objects, across all pages.
	 * @return
	 */
	int getCount();

	/**
	 * returns the number of objects on each page.
	 * @return
	 */
	int getPerPage();
	
	/**
	 * If non 0 the last page will not contain this number or less rows.
	 * 
	 * For example if perPage is set to 10 and orphans is 2,  a result set of 12 objects will only show a single page. (1-12)
	 * 
	 * @return
	 */
	int getOrphans();

}